<template>
  <div class="hello">
    <h2>我是Child组件:{{ car }}</h2>
    <button @click="getCar">发给demo2</button>
  </div>
</template>

<script>
export default {
  name: "Child",
  data() {
    return {
      car: '奔驰'
    }
  },
  methods: {
    getCar(){
      this.$bus.$emit('sendCar',this.car)
    }
  }
}
</script>

<style scoped>
.hello {
  background: #bfa;
  padding: 10px;
}
</style>